﻿package {
	//imports the necessary as events and Clip classes
	import flash.events.Event
	import flash.events.MouseEvent;
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class ButtonBase extends MovieClip{
        static public const CLICK:String = "_down";
		static public const OVER:String = "_over";
		static public const UP:String = "_up";
		
        function ButtonBase(){
			//attaching mouse events
			addEventListener(MouseEvent.CLICK, pClick);
			addEventListener(MouseEvent.MOUSE_OUT, pMouseOut);
			addEventListener(MouseEvent.MOUSE_OVER, pMouseOver);
		}

		function pClick(event:MouseEvent):void {
			gotoAndPlay(CLICK);

		}
		//On mouse out function
		function pMouseOut(event:MouseEvent):void {
			gotoAndPlay(UP);
		}
		//On mouse over function
		function pMouseOver(event:MouseEvent):void {
			gotoAndPlay(OVER);
		}
		
		
	}
	
}